const webpack = require('webpack')
const path = require('path')

function resolve(dir){
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: "./",
  assetsDir: "static",
  outputDir: 'yojoincn_touch',
  chainWebpack(config) {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('components', resolve('src/components'))
      .set('common', resolve('src/common'))
      .set('api', resolve('src/api'))

    config.plugin('context')
      .use(webpack.ContextReplacementPlugin,
        [/moment[/\\]locale$/, /zh-cn/])
  }
}
